//Set directory to folder with data and .do files

do "Latino variable coding.do"



//Figure 1, with OLS instead of ordered probit
reg willvote i.smalltreatment interest previousvote ib2.PID age income edu  woman employ imm if firsttime==1 & reject==0 & newwording==.  & speeder==0 
est store willvote
reg voteethusiasm i.smalltreatment interest previousvote ib2.PID age income edu  woman employ imm if firsttime==1 & reject==0 & newwording==.  & speeder==0  
est store voteethusiasm
reg politicalaction i.smalltreatment interest previousvote  ib2.PID age income edu  woman employ imm  if firsttime==1 & reject==0 & newwording==. & speeder==0 
est store politicalaction


esttab willvote voteethusiasm politicalaction using Table1.rtf , replace se r2 ar2  b(a2) compress modelwidth(8) ///
 nobaselevels label title(Treatment Effects - OLS Models)   nonumbers mtitles("Will Vote" "Vote Enthusiasm" "Political Actions") ///
 rename (1.smalltreatment Treatment interest Interest previousvote ///
 2018Turnout 1.PID Rep 3.PID Dem age Age income_new Income edu Education woman Woman employed Employed imm Immigrant)

esttab willvote voteethusiasm politicalaction using Table1.tex , replace se r2 ar2  b(a2) compress modelwidth(8) ///
 nobaselevels label title(Treatment Effects - OLS Models)   nonumbers mtitles("Will Vote" "Vote Enthusiasm" "Political Actions") ///
 rename (1.smalltreatment Treatment interest Interest previousvote ///
 2018Turnout 1.PID Rep 3.PID Dem age Age income_new Income edu Education woman Woman employed Employed imm Immigrant)

coefplot (willvote, ) (voteethusiasm, )  (politicalaction, )   ||, keep(*.smalltreatment)  drop(_cons) xline(0) byopts(xrescale placement(12))  scheme(plottig) legend(position(6))
gr_edit yaxis1.major.delete_tick 1
gr_edit legend.Edit, style(cols(3)) style(rows(0)) keepstyles 
gr_edit plotregion1.plot2.style.editstyle marker(symbol(triangle)) editcopy
gr_edit plotregion1.plot6.style.editstyle marker(symbol(square)) editcopy
gr_edit legend.plotregion1.label[1].text = {}
gr_edit legend.plotregion1.label[1].text.Arrpush Will Vote
gr_edit legend.plotregion1.label[2].text = {}
gr_edit legend.plotregion1.label[2].text.Arrpush Vote Ethusiasm
gr_edit legend.plotregion1.label[3].text = {}
gr_edit legend.plotregion1.label[3].text.Arrpush Political Actions
gr_edit plotregion1._xylines[1].style.editstyle linestyle(color(black)) editcopy
graph save "Figure 1.gph", replace
graph export "Figure 1.pdf", as(pdf) replace

//Figure 1, Political Action by Quartiles
eststo clear

ologit politicalactionquartiles i.smalltreatment interest previousvote ib2.PID age income edu  woman employ imm if firsttime==1 & reject==0 & newwording==.  & speeder==0 
est store politicalaction
margins , over(r.smalltreatment ) at((mean)_all) expression(predict(outcome(#1))) saving(file1, replace)
margins , over(r.smalltreatment ) at((mean)_all) expression(predict(outcome(#2))) saving(file2, replace)
margins , over(r.smalltreatment ) at((mean)_all) expression(predict(outcome(#3))) saving(file3, replace)
margins , over(r.smalltreatment ) at((mean)_all) expression(predict(outcome(#4))) saving(file4, replace)
combomarginsplot file1 file2 file3  file4 ,   scheme(plottig)  recast(scatter) yline(0, lcolor(black)) title("Enthusiasm to Vote", bexpand nospan) ytitle("Treatment Effect") xtitle(" ") ///
xlabel(1 "1st Q" 2 "2nd Q" 3 "3rd Q" 4 "4th Q" , angle(45) ) fxsize(100) fysize(100) name(ActionQuartiles, replace)
graph save "ActionQuartiles R&R.gph", replace

esttab politicalaction using ActionsQuartiles.rtf , replace se ar2 pr2 b(a2) compress modelwidth(8) ///
 nobaselevels label title(Political Action Quartiles)   nonumbers  mtitles("Political Actions") ///
  rename (1.smalltreatment Treatment ethID LatinoID   1.smalltreatment#c.ethID ///
 Treatment*LID  interest Interest previousvote  2018Turnout 1.PID Rep 3.PID Dem age Age income_new Income edu Education ///
 woman Woman employed Employed imm Immigrant) 
 
 esttab politicalaction using ActionsQuartiles.tex , replace se ar2 pr2 b(a2) compress modelwidth(8) ///
 nobaselevels label title(Political Action Quartiles)   nonumbers  mtitles("Political Actions") ///
  rename (1.smalltreatment Treatment ethID LatinoID   1.smalltreatment#c.ethID ///
 Treatment*LID  interest Interest previousvote  2018Turnout 1.PID Rep 3.PID Dem age Age income_new Income edu Education ///
 woman Woman employed Employed imm Immigrant) 
 


//Figure 1, Two treatments

reg willvote i.treatment interest previousvote ib2.PID age income edu  woman employ imm if firsttime==1 & reject==0 & newwording==.  & speeder==0 
est store willvote

reg voteethusiasm i.treatment interest previousvote ib2.PID age income edu  woman employ imm if firsttime==1 & reject==0 & newwording==.  & speeder==0  
est store voteethusiasm

reg politicalaction i.treatment interest previousvote  ib2.PID age income edu  woman employ imm  if firsttime==1 & reject==0 & newwording==. & speeder==0 
est store politicalaction

esttab willvote voteethusiasm politicalaction using Table1ATwoTreatments.rtf , replace se r2 ar2  b(a2) compress modelwidth(8) ///
 nobaselevels label title(Two Treatments)   nonumbers mtitles("Will Vote" "Vote Enthusiasm" "Interest" "Political Actions") ///
 rename (01.treatmentt Ethnicity 2.treatment Immigration interest Interest previousvote ///
 2018Turnout 1.PID Rep 3.PID Dem age Age income_new Income edu Education woman Woman employed Employed imm Immigrant)

esttab willvote voteethusiasm politicalaction using Table1ATwoTreatments.tex , replace se r2 ar2  b(a2) compress modelwidth(8) ///
 nobaselevels label title(Two Treatments)   nonumbers mtitles("Will Vote" "Vote Enthusiasm" "Interest" "Political Actions") ///
 rename (01.treatmentt Ethnicity 2.treatment Immigration interest Interest previousvote ///
 2018Turnout 1.PID Rep 3.PID Dem age Age income_new Income edu Education woman Woman employed Employed imm Immigrant)


coefplot  (willvote, ) (voteethusiasm, ) (politicalaction, )  ||, keep(*.treatment) drop(_cons) xline(0) byopts(xrescale placement(12))  scheme(plottig) legend(position(6))
gr_edit plotregion1.plot2.style.editstyle marker(symbol(triangle)) editcopy
gr_edit plotregion1.plot6.style.editstyle marker(symbol(square)) editcopy
gr_edit legend.Edit, style(cols(3)) style(rows(0)) keepstyles 
gr_edit legend.plotregion1.label[1].text = {}
gr_edit legend.plotregion1.label[1].text.Arrpush Will Vote
gr_edit legend.plotregion1.label[2].text = {}
gr_edit legend.plotregion1.label[2].text.Arrpush Vote Ethusiasm
gr_edit legend.plotregion1.label[3].text = {}
gr_edit legend.plotregion1.label[3].text.Arrpush Political Actions
gr_edit plotregion1._xylines[1].style.editstyle linestyle(color(black)) editcopy
graph save "Figure 1A - Vote Two Treatments.gph", replace
graph export "Figure 1A - Two Treatments.pdf", as(pdf) replace



//Figure 2, with ordered probit instead of OLS
eststo clear

ologit willvote i.smalltreatment##c.ethID interest previousvote i.ib2.PID age income edu  woman employ imm  if firsttime==1 & reject==0 & newwording==. & speeder==0 
est store willvote
margins ,  over(r.smalltreatment ) at( (mean)_all ethID=(0(2)10)) expression(predict(outcome(#1))) saving(file1, replace)
margins ,  over(r.smalltreatment ) at( (mean)_all ethID=(0(2)10)) expression(predict(outcome(#2))) saving(file2, replace)
margins ,  over(r.smalltreatment ) at( (mean)_all ethID=(0(2)10)) expression(predict(outcome(#3))) saving(file3, replace)
margins ,  over(r.smalltreatment ) at( (mean)_all ethID=(0(2)10)) expression(predict(outcome(#4))) saving(file4, replace)
combomarginsplot file1 file2 file3  file4 ,  recast(connected) noci  scheme(plottig) legend(pos(6) size(small) row(2) ) ///
title("Will Vote - Treatment Effects", bexpand nospan) ytitle("Will Vote") xtitle("Latino Identity")  yline(0, lcolor(black)) ///
plot1opts(msymbol(square)) plot2opts(msymbol(triangle)) plot3opts(msymbol(circle_hollow)) fxsize(100) fysize(100)  ///
legend(pos(6) row(2) order(1 "Definitely Not" 2 "Probably Not" 3 "Probably Will" 4 "Definitely Will")) name(WillvoteID, replace)
 
ologit voteethusiasm i.smalltreatment##c.ethID interest previousvote i.ib2.PID age income edu  woman employ imm  if firsttime==1 & reject==0 & newwording==. & speeder==0 
est store voteethusiasm
margins ,  over(r.smalltreatment ) at( (mean)_all ethID=(0(2)10)) expression(predict(outcome(#1))) saving(file1, replace)
margins ,  over(r.smalltreatment ) at( (mean)_all ethID=(0(2)10)) expression(predict(outcome(#2))) saving(file2, replace)
margins ,  over(r.smalltreatment ) at( (mean)_all ethID=(0(2)10)) expression(predict(outcome(#3))) saving(file3, replace)
combomarginsplot file1 file2 file3  ,  recast(connected) noci  scheme(plottig) legend(pos(6) size(small) row(2) ) ///
title("Vote  Enthusiasm - Treatment Effects", bexpand nospan) ytitle("Treatment Effects") xtitle("Latino Identity")  yline(0, lcolor(black)) ///
plot1opts(msymbol(square)) plot2opts(msymbol(triangle)) plot3opts(msymbol(circle_hollow)) fxsize(100) fysize(100)  ///
legend(pos(6) row(2) order(1 "Not" 2 "Somewhat" 3 "Very" )) name(EnthusID, replace)


gr combine WillvoteID EnthusID  , scheme(plottig)    xsize(4) ysize(8) col(1)
graph save "Figure 2 - By Latino ID Probit.gph", replace
graph export "Figure 2 - By Latino ID Probit.pdf", as(pdf) replace

esttab willvote voteethusiasm  using Table2Probit.rtf , replace se ar2 pr2 b(a2) compress modelwidth(8) ///
 nobaselevels label title(Latino Identity Interaction)   nonumbers mtitles("Will Vote" "Vote Enthusiasm" "Political Actions") ///
 addnote("Note: Ordered Logit and OLS Models")  rename (1.smalltreatment Treatment ethID LatinoID   1.smalltreatment#c.ethID Treatment*LID  interest Interest previousvote ///
 2018Turnout 1.PID Rep 3.PID Dem age Age income_new Income edu Education woman Woman employed Employed imm Immigrant) 

esttab willvote voteethusiasm  using Table2Probit.tex, replace se ar2  pr2 b(a2) compress modelwidth(8) ///
 nobaselevels label title(Latino Identity Interaction)   nonumbers mtitles("Will Vote" "Vote Enthusiasm" "Political Actions") ///
 addnote("Note: Ordered Logit and OLS Models")  rename (1.smalltreatment Treatment ethID LatinoID   1.smalltreatment#c.ethID Treatment*LID  interest Interest previousvote ///
 2018Turnout 1.PID Rep 3.PID Dem age Age income_new Income edu Education woman Woman employed Employed imm Immigrant) 

 


//Figure 2, Two Treatments
reg willvote i.treatment##c.ethID interest previousvote i.ib2.PID age income edu  woman employ imm  if firsttime==1 & reject==0 & newwording==. & speeder==0 
est store willvote
margins,  at( ethID=(0(1) 10) treatment= (0 1 2))
marginsplot,   recast(line) noci scheme(plottig) legend(off) title("Will Vote", bexpand nospan) ytitle("Will Vote") xtitle("Latino Identity")  
gr_edit plotregion1.plot1.style.editstyle line(pattern(dash)) editcopy
graph save "Figure 2A - Vote and ID.gph", replace

margins, over(r.treatment ) at((mean)_all ethID=(0(1) 10))
marginsplot, recast(line) noci scheme(plottig) legend(off) title("Will Vote - Treatment Effects", bexpand nospan) ytitle("Treatment Effect") xtitle("Latino Identity") yline(0, lcolor(black))
gr_edit plotregion1.plot2.style.editstyle line(color(maroon)) editcopy
graph save "Figure 2A - Vote and ID Treat.gph", replace

reg voteethusiasm i.treatment##c.ethID  interest previousvote i.ib2.PID age income edu  woman employ imm  if firsttime==1 & reject==0 & newwording==. & speeder==0 
est store voteethusiasm
margins,  at( ethID=(0(1) 10) treatment= (0 1 2))
marginsplot, recast(line) noci scheme(plottig) legend(off) title("Vote Enthusiasm", bexpand nospan) ytitle("Vote Enthusiasm") xtitle("Latino Identity")
gr_edit plotregion1.plot1.style.editstyle line(pattern(dash)) editcopy
graph save "Figure 2A - Enthusiasm and ID.gph", replace

margins, over(r.treatment ) at((mean)_all ethID=(0(1) 10))
marginsplot, recast(line) noci scheme(plottig) legend(off) title("Vote Enthusiasm - Treatment Effects", bexpand nospan) ytitle("Treatment Effect") xtitle("Latino Identity") yline(0, lcolor(black))
gr_edit plotregion1.plot2.style.editstyle line(color(maroon)) editcopy
graph save "Figure 2A - Enthusiasm and ID Treat.gph", replace

reg politicalaction i.treatment##c.ethID  interest previousvote i.ib2.PID age income edu  woman employ imm  if firsttime==1 & reject==0 & newwording==. & speeder==0 
est store politicalaction
margins,  at( ethID=(0(1) 10) treatment= (0 1 2))
marginsplot,   recast(line) noci scheme(plottig) legend(position(6) col(3))   title("Political Actions", bexpand nospan) ytitle("Political Actions") xtitle("Latino Identity") 
gr_edit plotregion1.plot1.style.editstyle line(pattern(dash)) editcopy
graph save "Figure 2A - Action and ID.gph", replace

margins, over(r.treatment ) at((mean)_all ethID=(0(1) 10))
marginsplot,  recast(line) noci scheme(plottig) legend(position(6) row(1))   title("Political Actions - Treatment Effects", bexpand nospan) ytitle("Treatment Effect") xtitle("Latino Identity") yline(0, lcolor(black))
gr_edit plotregion1.plot2.style.editstyle line(color(maroon)) editcopy
graph save "Figure 2A - Action and ID Treat.gph", replace


graph combine "Figure 2A - Vote and ID.gph" "Figure 2A - Vote and ID Treat.gph" ///
"Figure 2A - Enthusiasm and ID.gph" "Figure 2A - Enthusiasm and ID Treat.gph" /// 
"Figure 2A - Action and ID.gph" "Figure 2A - Action and ID Treat.gph" ///
, row(3)  scheme(plottig) commonscheme name(VoteLatinoID, replace)
graph display VoteLatinoID, xsize(4) ysize(6)
gr_edit plotregion1.graph6.legend.plotregion1.label[1].text = {}
gr_edit plotregion1.graph6.legend.plotregion1.label[1].text.Arrpush Ethnicity vs Econ
gr_edit plotregion1.graph6.legend.plotregion1.label[2].text = {}
gr_edit plotregion1.graph6.legend.plotregion1.label[2].text.Arrpush Imm vs Econ
gr_edit plotregion1.graph5.legend.plotregion1.label[1].text = {}
gr_edit plotregion1.graph5.legend.plotregion1.label[1].text.Arrpush Econ
gr_edit plotregion1.graph5.legend.plotregion1.label[3].text = {}
gr_edit plotregion1.graph5.legend.plotregion1.label[3].text.Arrpush Imm
graph save "Figure 2A - Two Treatments and ID.gph", replace
graph export "Figure 2A - Two Treatments and ID.pdf", as(pdf) replace

esttab willvote voteethusiasm politicalaction using Table2AVoteLatinoID.rtf , replace se r2 ar2  b(a2) compress modelwidth(8) ///
 nobaselevels label title(Latino ID, Two Treatments)   nonumbers mtitles("Will Vote" "Vote Enthusiasm" "Political Actions") ///
  rename (1.treatment EthnicTreatment 2.treatment ImmTreatment ethID LatinoID   1.treatment#c.ethID EthnicTreatment*LID 2.treatment#c.ethID ImmTreatment*LID  interest Interest previousvote ///
 2018Turnout 1.PID Rep 3.PID Dem age Age income_new Income edu Education woman Woman employed Employed imm Immigrant) 

esttab willvote voteethusiasm politicalaction using Table2AVoteLatinoID.tex , replace se r2 ar2  b(a2) compress modelwidth(8) ///
 nobaselevels label title(Latino ID, Two Treatments)   nonumbers mtitles("Will Vote" "Vote Enthusiasm" "Political Actions") ///
  rename (1.treatment EthnicTreatment 2.treatment ImmTreatment ethID LatinoID   1.treatment#c.ethID EthnicTreatment*LID 2.treatment#c.ethID ImmTreatment*LID  interest Interest previousvote ///
 2018Turnout 1.PID Rep 3.PID Dem age Age income_new Income edu Education woman Woman employed Employed imm Immigrant) 


 
 //With and without covariates
reg willvote i.smalltreatment  if firsttime==1 & reject==0 & newwording==.  & speeder==0 
est store willvote
reg voteethusiasm i.smalltreatment  if firsttime==1 & reject==0 & newwording==.  & speeder==0  
est store voteethusiasm
reg politicalaction i.smalltreatment  if firsttime==1 & reject==0 & newwording==.  & speeder==0  
est store politicalaction

reg willvote i.smalltreatment interest previousvote ib2.PID age income edu  woman employ imm if firsttime==1 & reject==0 & newwording==.  & speeder==0 
est store willvotecontrols
reg voteethusiasm i.smalltreatment interest previousvote ib2.PID age income edu  woman employ imm if firsttime==1 & reject==0 & newwording==.  & speeder==0  
est store voteethusiasmcontrols
reg politicalaction i.smalltreatment interest previousvote ib2.PID age income edu  woman employ imm if firsttime==1 & reject==0 & newwording==.  & speeder==0  
est store politicalactioncontrols

coefplot willvote willvotecontrols voteethusiasm voteethusiasmcontrols politicalaction politicalactioncontrols ||, keep(*.smalltreatment)  drop(_cons) xline(0) byopts(xrescale placement(12))  scheme(plottig) legend(position(6))
graph save "Figure 1B - Vote Covariates.gph", replace
graph use "Figure 1B - Vote Covariates.gph", play("Figure 1A - Vote Covariates") 
gr_edit legend.plotregion1.label[5].text = {}
gr_edit legend.plotregion1.label[5].text.Arrpush Political Actions
gr_edit legend.plotregion1.label[6].text = {}
gr_edit legend.plotregion1.label[6].text.Arrpush Political Actions Covariates
gr_edit legend.plotregion1.key[5].view.style.editstyle marker(symbol(diamond)) editcopy
gr_edit legend.plotregion1.key[6].view.style.editstyle marker(symbol(diamond_hollow)) editcopy
graph save "Figure 1B - Vote Covariates.gph", replace
graph export "Figure 1B - Vote Covariates.pdf", as(pdf) replace

esttab willvote willvotecontrols  voteethusiasm voteethusiasmcontrols politicalaction politicalactioncontrols using Table1BVoteControls.rtf , replace se r2 ar2  b(a2) compress modelwidth(8) ///
 nobaselevels label title(With and Without Covariates)   nonumbers  mtitles("Will Vote" "Will Vote Covariates" "Vote Enthusiasm" "Vote Enthusiasm Covariates" "Political Actions" "Political Actions Covariates") ///
 addnote("Note: OLS Models, comparable to Figure 1 in the main text.") rename (1.smalltreatment Treatment interest Interest previousvote ///
 2018Turnout 1.PID Rep 3.PID Dem age Age income_new Income edu Education woman Woman employed Employed imm Immigrant)


esttab willvote willvotecontrols  voteethusiasm voteethusiasmcontrols politicalaction politicalactioncontrols using Table1BVoteControls.tex, replace se r2 ar2  b(a2) compress modelwidth(8) ///
 nobaselevels label title(With and Without Covariates)   nonumbers  mtitles("Will Vote" "Will Vote Covariates" "Vote Enthusiasm" "Vote Enthusiasm Covariates" "Political Actions" "Political Actions Covariates") ///
 addnote("Note: OLS Models, comparable to Figure 1 in the main text.") rename (1.smalltreatment Treatment interest Interest previousvote ///
 2018Turnout 1.PID Rep 3.PID Dem age Age income_new Income edu Education woman Woman employed Employed imm Immigrant)



/* Not using in current version

//National Origins
reg willvote i.smalltreatment##nationality interest previousvote ib2.PID yearofbirth income edu  woman employ imm if firsttime==1 & reject==0 & newwording==.  & speeder==0 
est store willvote
margins, over(r.smalltreatment )  at( nationality=(0(1)4) )
marginsplot,   scheme(plottig) legend(off) title("Treatment Effects by National Origin") ytitle("Treatment Effect") xtitle("National Origin")
graph save "Figure 1C - Will Vote by National Origin.gph", replace


reg voteethusiasm i.smalltreatment##nationality  interest previousvote ib2.PID yearofbirth income edu  woman employ imm if firsttime==1 & reject==0 & newwording==.  & speeder==0  
est store voteethusiasm
margins, over(r.smalltreatment )  at( nationality=(0(1)4) )
marginsplot,   scheme(plottig) legend(off) title("Treatment Effects by National Origin") ytitle("Treatment Effect") xtitle("National Origin")
graph save "Figure 1C - Vote Ethusiasm by National Origin.gph", replace


esttab willvote voteethusiasm using Table1CVote.rtf , replace se r2 ar2  b(a2) compress modelwidth(8) ///
 nobaselevels label title(Table 1 - Participation)   nonumbers mtitles("Will Vote" "Vote Enthusiasm") ///
 addnote("Note: OLS Models used in Figure 1C") rename (1.smalltreatment Treatment   1.smalltreatment#1.nationality Treatment*PuertoRican ///
  1.smalltreatment#2.nationality Treatment*Cuban  1.smalltreatment#3.nationality Treatment*Dominican  1.smalltreatment#4.nationality Treatment*Other ///
 interest Interest previousvote 2018Turnout 1.PID Rep 3.PID Dem yearofbirthyofbirth YearofBirth income_new Income edu Education woman Woman employed Employed imm Immigrant)

esttab willvote voteethusiasm using Table1CVote.tex , replace se r2 ar2  b(a2) compress modelwidth(8) ///
 nobaselevels label title(Table 1 - Participation)   nonumbers mtitles("Will Vote" "Vote Enthusiasm") ///
 addnote("Note: OLS Models used in Figure 1C") rename (1.smalltreatment Treatment   1.smalltreatment#1.nationality Treatment*PuertoRican ///
  1.smalltreatment#2.nationality Treatment*Cuban  1.smalltreatment#3.nationality Treatment*Dominican  1.smalltreatment#4.nationality Treatment*Other ///
 interest Interest previousvote 2018Turnout 1.PID Rep 3.PID Dem yearofbirthyofbirth YearofBirth income_new Income edu Education woman Woman employed Employed imm Immigrant)
 
grc1leg "Figure 1C - Will Vote by National Origin.gph" "Figure 1C - Vote Ethusiasm by National Origin.gph" ///
, row(1)  scheme(plottig) commonscheme name(VoteLatinoID, replace)
graph display VoteLatinoID, xsize(8) ysize(4)
graph save "Figure 1C - Vote by National Origin.gph", replace
graph use  "Figure 1C - Vote by National Origin.gph", play("Figure 1C - National Origin.grec") 
graph save "Figure 1C - Vote by National Origin", replace
graph export "Figure 1C - Vote by National Origin.pdf", as(pdf) replace

*/



//Linked Fate
reg willvote i.smalltreatment##c.ethLinked i.smalltreatment##c.ethID interest previousvote i.ib2.PID age income edu  woman employ imm  if firsttime==1 & reject==0 & newwording==. & speeder==0 
est store willvote

margins, over(r.smalltreatment ) at((mean)_all ethID=(7.5) ethLinked=(0  .3333 .6666 1))
marginsplot, recast(line) recastci(rarea) scheme(plottig) legend(off) title("Will Vote, Latino Linked Fate" "Controling for Latino ID", bexpand nospan) ytitle("Treatment Effect") xtitle("Latino Linked Fate")  ///
xlabel(0 "Not At All" .3333 "A Little" .6666 "Somewhat" 1 "A Lot")  yline(0, lcolor(black))
gr_edit plotregion1.plot1.style.editstyle area(linestyle(color("%50"))) editcopy
gr_edit plotregion1.plot1.style.editstyle area(shadestyle(color("%50"))) editcopy
gr_edit plotregion1.plot1.style.editstyle area(shadestyle(intensity(50))) editcopy
gr_edit plotregion1.plot2.style.editstyle line(color(maroon)) editcopy
graph save "Figure 2B - Will Vote, Linked Fate.gph", replace

margins, over(r.smalltreatment ) at((mean)_all ethLinked=(.56) ethID=(0(1) 10))
marginsplot, recast(line) recastci(rarea) scheme(plottig) legend(off) title("Will Vote, Latino ID"  "Controling for Latino Linked Fate", bexpand nospan) ytitle("Treatment Effect") xtitle("Latino ID") yline(0, lcolor(black))
gr_edit plotregion1.plot1.style.editstyle area(linestyle(color("%50"))) editcopy
gr_edit plotregion1.plot1.style.editstyle area(shadestyle(color("%50"))) editcopy
gr_edit plotregion1.plot1.style.editstyle area(shadestyle(intensity(50))) editcopy
gr_edit plotregion1.plot2.style.editstyle line(color(maroon)) editcopy
graph save "Figure 2B - Will Vote, ID.gph", replace

reg voteethusiasm i.smalltreatment##c.ethLinked i.smalltreatment##c.ethID interest previousvote i.ib2.PID age income edu  woman employ imm  if firsttime==1 & reject==0 & newwording==. & speeder==0 
est store voteethusiasm

margins, over(r.smalltreatment ) at((mean)_all ethID=(7.5) ethLinked=(0  .3333 .6666 1))
marginsplot, recast(line) recastci(rarea) scheme(plottig) legend(off) title("Vote Enthusiasm, Latino Linked Fate" "Controling for Latino ID", bexpand nospan) ytitle("Treatment Effect") xtitle("Latino Linked Fate") ///
xlabel(0 "Not At All" .3333 "A Little" .6666 "Somewhat" 1 "A Lot")  yline(0, lcolor(black))
gr_edit plotregion1.plot1.style.editstyle area(linestyle(color("%50"))) editcopy
gr_edit plotregion1.plot1.style.editstyle area(shadestyle(color("%50"))) editcopy
gr_edit plotregion1.plot1.style.editstyle area(shadestyle(intensity(50))) editcopy
gr_edit plotregion1.plot2.style.editstyle line(color(maroon)) editcopy
graph save "Figure 2B - Enthusiasm Linked Fate.gph", replace

margins, over(r.smalltreatment ) at((mean)_all ethLinked=(.56) ethID=(0(1) 10))
marginsplot, recast(line) recastci(rarea) scheme(plottig) legend(off) title("Vote Enthusiasm, Latino ID" "Controling for Latino Linked Fate", bexpand nospan) ytitle("Treatment Effect") xtitle("Latino ID") yline(0, lcolor(black))
gr_edit plotregion1.plot1.style.editstyle area(linestyle(color("%50"))) editcopy
gr_edit plotregion1.plot1.style.editstyle area(shadestyle(color("%50"))) editcopy
gr_edit plotregion1.plot1.style.editstyle area(shadestyle(intensity(50))) editcopy
gr_edit plotregion1.plot2.style.editstyle line(color(maroon)) editcopy
graph save "Figure 2B - Enthusiasm ID Treat.gph", replace


reg politicalaction i.smalltreatment##c.ethLinked i.smalltreatment##c.ethID interest previousvote ib2.PID age income edu  woman employ imm  if firsttime==1 & reject==0 & newwording==. & speeder==0 
est store politicalaction

margins, over(r.smalltreatment ) at((mean)_all ethID=(7.5) ethLinked=(0  .3333 .6666 1))
marginsplot, recast(line) recastci(rarea) scheme(plottig) legend(off) title("Political Actions, Latino Linked Fate" "Controling for Latino ID", bexpand nospan) ytitle("Treatment Effect") xtitle("Latino Linked Fate") ///
xlabel(0 "Not At All" .3333 "A Little" .6666 "Somewhat" 1 "A Lot")  yline(0, lcolor(black))
gr_edit plotregion1.plot1.style.editstyle area(linestyle(color("%50"))) editcopy
gr_edit plotregion1.plot1.style.editstyle area(shadestyle(color("%50"))) editcopy
gr_edit plotregion1.plot1.style.editstyle area(shadestyle(intensity(50))) editcopy
gr_edit plotregion1.plot2.style.editstyle line(color(maroon)) editcopy
graph save "Figure 2B - Actions Linked.gph", replace

margins, over(r.smalltreatment ) at((mean)_all ethLinked=(.56) ethID=(0(1) 10))
marginsplot, recast(line) recastci(rarea) scheme(plottig) legend(off) title("Political Actions, Latino ID" "Controling for Latino Linked Fate", bexpand nospan) ytitle("Treatment Effect") xtitle("Latino ID") yline(0, lcolor(black))
gr_edit plotregion1.plot1.style.editstyle area(linestyle(color("%50"))) editcopy
gr_edit plotregion1.plot1.style.editstyle area(shadestyle(color("%50"))) editcopy
gr_edit plotregion1.plot1.style.editstyle area(shadestyle(intensity(50))) editcopy
gr_edit plotregion1.plot2.style.editstyle line(color(maroon)) editcopy
graph save "Figure 2B - Actions ID.gph", replace



graph combine  "Figure 2B - Will Vote, ID.gph" "Figure 2B - Will Vote, Linked Fate.gph" ///
 "Figure 2B - Enthusiasm ID Treat.gph" "Figure 2B - Enthusiasm Linked Fate.gph" ///
"Figure 2B - Actions ID.gph" "Figure 2B - Actions Linked.gph" /// 
, row(3)  scheme(plottig) commonscheme name(VoteLatinoIDLinkedFate, replace) 
graph display VoteLatinoIDLinkedFate, xsize(4) ysize(6)
graph save "Figure 2B - Latino ID and Linked .gph", replace
graph export "Figure 2B - Latino ID and Linked.pdf", as(pdf) replace


esttab willvote voteethusiasm politicalaction using Table2BLatinoIDLinkedFate.rtf , replace se r2 ar2  b(a2) compress modelwidth(8) ///
 nobaselevels label title(Linked Fate and Latino Identity)   nonumbers mtitles("Will Vote" "Vote Enthusiasm" "Political Actions") ///
 rename (1.smalltreatment Treatment ethID LatinoID   1.smalltreatment#c.ethID Treatment*LID ethLinked LinkedFate ///
 1.smalltreatment#c.ethLinked Treatment*LinkedFate interest Interest previousvote ///
 2018Turnout 1.PID Rep 3.PID Dem age Age income_new Income edu Education woman Woman employed Employed imm Immigrant) 

esttab willvote voteethusiasm politicalaction using Table2BLatinoIDLinkedFate.tex , replace se r2 ar2  b(a2) compress modelwidth(8) ///
 nobaselevels label title(Linked Fate and Latino Identity)   nonumbers mtitles("Will Vote" "Vote Enthusiasm" "Political Actions") ///
 rename (1.smalltreatment Treatment ethID LatinoID   1.smalltreatment#c.ethID Treatment*LID ethLinked LinkedFate ///
 1.smalltreatment#c.ethLinked Treatment*LinkedFate interest Interest previousvote ///
 2018Turnout 1.PID Rep 3.PID Dem age Age income_new Income edu Education woman Woman employed Employed imm Immigrant) 




//Seperate political actions
reg politicalaction i.smalltreatment interest previousvote ib2.PID age income edu  woman employ imm  if firsttime==1 & reject==0 & newwording==. & speeder==0 
est store politicalaction
reg Donate i.smalltreatment interest previousvote ib2.PID age income edu  woman employ imm  if firsttime==1 & reject==0 & newwording==. & speeder==0 
est store donate
reg SocialMedia i.smalltreatment interest previousvote ib2.PID age income edu  woman employ imm  if firsttime==1 & reject==0 & newwording==. & speeder==0 
est store socialmedia
reg Petition i.smalltreatment interest previousvote ib2.PID age income edu  woman employ imm  if firsttime==1 & reject==0 & newwording==. & speeder==0 
est store petition
reg Protest i.smalltreatment interest previousvote ib2.PID age income edu  woman employ imm  if firsttime==1 & reject==0 & newwording==. & speeder==0 
est store protest
reg Discuss i.smalltreatment interest previousvote ib2.PID age income edu  woman employ imm  if firsttime==1 & reject==0 & newwording==. & speeder==0 
est store discuss
reg Volunteer i.smalltreatment interest previousvote ib2.PID age income edu  woman employ imm  if firsttime==1 & reject==0 & newwording==. & speeder==0 
est store volunteer

coefplot politicalaction donate socialmedia petition protest discuss volunteer||, keep(*.smalltreatment) drop(_cons) xline(0) byopts(xrescale placement(12))  scheme(plottig) legend(position(6))
graph save "Figure 1C - Political Actions.gph", replace
graph use "Figure 1C - Political Actions.gph", play("Figure 1D - Political Actions.grec")
graph save "Figure 1C - Political Actions.gph", replace
graph export "Figure 1C - Political Actions.pdf", as(pdf) replace

esttab politicalaction donate  socialmedia  petition   protest  discuss  volunteer using Table1CPoliticalActions.rtf , replace se r2 ar2  b(a3) compress modelwidth(8) ///
 nobaselevels label title(Seperate Political Actions)   nonumbers mtitles("Political Action Scale" "Donate"  "Social Media"  "Petition"  "Protest"  "Discuss"  "Volunteer") ///
  rename (1.smalltreatment Treatment interest Interest previousvote ///
 2018Turnout 1.PID Rep 3.PID Dem age Age income_new Income edu Education woman Woman employed Employed imm Immigrant) 

esttab politicalaction donate  socialmedia  petition   protest  discuss  volunteer using Table1CPoliticalActions.tex, replace se r2 ar2  b(a3) compress modelwidth(8) ///
 nobaselevels label title(Seperate Political Actions)   nonumbers mtitles("Political Action Scale" "Donate"  "Social Media"  "Petition"  "Protest"  "Discuss"  "Volunteer") ///
   rename (1.smalltreatment Treatment interest Interest previousvote ///
 2018Turnout 1.PID Rep 3.PID Dem age Age income_new Income edu Education woman Woman employed Employed imm Immigrant) 

 
 

//Immigration Status, Replacing Latino ID  
reg willvote i.smalltreatment##c.imm   i.ib2.PID age income edu  woman employ   if firsttime==1 & reject==0 & newwording==. & speeder==0
est store willvoteImm 
margins, over(r.smalltreatment ) at((mean)_all  imm =(0 1))
marginsplot,  scheme(plottig) legend(off) title("Will Vote and Immigrant Status", bexpand nospan) ytitle("Treatment Effect") xtitle("Immigrant Status") xlabel(0 "US Born" 1 "Imm")
graph save "Figure 1D - Vote by Imm.gph", replace

reg voteethusiasm i.smalltreatment##c.imm   i.ib2.PID age income edu  woman employ   if firsttime==1 & reject==0 & newwording==. & speeder==0
est store enthusiamImm 
margins, over(r.smalltreatment ) at((mean)_all  imm =(0 1))
marginsplot,  scheme(plottig) legend(off) title("Vote Enthusiasm and Immigrant Status", bexpand nospan) ytitle("Treatment Effect") xtitle("Immigrant Status") xlabel(0 "US Born" 1 "Imm")
graph save "Figure 1D - Enthusiam by Imm.gph", replace

reg politicalaction i.smalltreatment##c.imm   i.ib2.PID age income edu  woman employ   if firsttime==1 & reject==0 & newwording==. & speeder==0
est store actionImm 
margins, over(r.smalltreatment ) at((mean)_all  imm =(0 1))
marginsplot,  scheme(plottig) legend(off) title("Political Actions and Immigrant Status", bexpand nospan) ytitle("Treatment Effect") xtitle("Immigrant Status") xlabel(0 "US Born" 1 "Imm")
graph save "Figure 1D - Actions by Imm.gph", replace

graph combine "Figure 1D - Vote by Imm.gph" "Figure 1D - Enthusiam by Imm.gph" "Figure 1D - Actions by Imm.gph" ///
, row(1)  scheme(plottig) commonscheme  xsize(8) ysize(4)
graph save "Figure 1D - Treatment Effects by Imm.gph", replace
graph export "Figure 1D - Treatment Effects by Imm.pdf", as(pdf) replace


esttab  willvoteImm enthusiamImm actionImm using Table1DImm.rtf , replace se r2 ar2  b(a3) compress modelwidth(8) ///
 nobaselevels label title(Immigrant Status)   nonumbers mtitles("Will Vote"  "Vote Enthusiasm"  "Political Actions") ///
 rename (1.smalltreatment Treatment 1.smalltreatment#c.imm Treatment*Immigrant interest Interest previousvote ///
 2018Turnout 1.PID Rep 3.PID Dem age Age income_new Income edu Education woman Woman employed Employed imm Immigrant) 

esttab  willvoteImm enthusiamImm actionImm using Table1DImm.tex , replace se r2 ar2  b(a3) compress modelwidth(8) ///
 nobaselevels label title(Immigrant Status)   nonumbers mtitles("Donate"  "Social Media"  "Petition"  "Protest"  "Discuss"  "Volunteer") ///
  rename (1.smalltreatment Treatment 1.smalltreatment#c.imm Treatment*Immigrant interest Interest previousvote ///
 2018Turnout 1.PID Rep 3.PID Dem age Age income_new Income edu Education woman Woman employed Employed imm Immigrant) 

 

//National Identity instead of Latino Identity
reg willvote i.smalltreatment##c.natID interest previousvote i.ib2.PID age income edu  woman employ imm  if firsttime==1 & reject==0 & newwording==. & speeder==0 
est store willvote
margins,  at( natID=(0(1) 10) smalltreatment= (0 1))
marginsplot,   recast(line) noci  legend(off) title("Will Vote", bexpand nospan) ytitle("Will Vote") xtitle("National Origin Identity") scheme(plottig)
gr_edit plotregion1.plot1.style.editstyle line(pattern(dash)) editcopy
graph save "Figure 2C - Vote and NatID.gph", replace

margins, over(r.smalltreatment ) at((mean)_all natID=(0(1) 10))
marginsplot, recast(line) recastci(rarea) scheme(plottig) legend(off) title("Will Vote - Treatment Effects", bexpand nospan) ytitle("Will Vote") xtitle("National Origin Identity") yline(0, lcolor(black))
gr_edit plotregion1.plot1.style.editstyle area(shadestyle(color("%50"))) editcopy
gr_edit plotregion1.plot1.style.editstyle area(shadestyle(intensity(50))) editcopy
gr_edit plotregion1.plot2.style.editstyle line(color(maroon)) editcopy
graph save "Figure 2C - Vote and NatID Treat.gph", replace

reg voteethusiasm i.smalltreatment##c.natID  interest previousvote i.ib2.PID age income edu  woman employ imm  if firsttime==1 & reject==0 & newwording==. & speeder==0 
est store voteethusiasm
margins,  at( natID=(0(1) 10) smalltreatment= (0 1))
marginsplot,   recast(line) noci scheme(plottig) legend(off) title("Vote Enthusiasm", bexpand nospan) ytitle("Vote Enthusiasm") xtitle("National Origin Identity") 
gr_edit plotregion1.plot1.style.editstyle line(pattern(dash)) editcopy
graph save "Figure 2C - Enthus and NatID.gph", replace

margins, over(r.smalltreatment ) at((mean)_all natID=(0(1) 10))
marginsplot, recast(line) recastci(rarea) scheme(plottig) legend(off) title("Vote Enthusiasm - Treatment Effects", bexpand nospan) ytitle("Vote Enthusiasm") xtitle("National Origin Identity") yline(0, lcolor(black))
gr_edit plotregion1.plot1.style.editstyle area(shadestyle(color("%50"))) editcopy
gr_edit plotregion1.plot1.style.editstyle area(shadestyle(intensity(50))) editcopy
gr_edit plotregion1.plot2.style.editstyle line(color(maroon)) editcopy
graph save "Figure 2C - Enthus and NatID Treat.gph", replace

reg politicalaction i.smalltreatment##c.natID  interest previousvote i.ib2.PID age income edu  woman employ imm  if firsttime==1 & reject==0 & newwording==. & speeder==0 
est store politicalaction
margins,  at( natID=(0(1) 10) smalltreatment= (0 1))
marginsplot,   recast(line) noci scheme(plottig) legend(off) title("Vote Enthusiasm", bexpand nospan) ytitle("Vote Enthusiasm") xtitle("National Origin Identity") 
gr_edit plotregion1.plot1.style.editstyle line(pattern(dash)) editcopy
graph save "Figure 2C - Actions and NatID.gph", replace

margins, over(r.smalltreatment ) at((mean)_all natID=(0(1) 10))
marginsplot, recast(line) recastci(rarea) scheme(plottig) legend(off) title("Vote Enthusiasm - Treatment Effects", bexpand nospan) ytitle("Vote Enthusiasm") xtitle("National Origin Identity") yline(0, lcolor(black))
gr_edit plotregion1.plot1.style.editstyle area(shadestyle(color("%50"))) editcopy
gr_edit plotregion1.plot1.style.editstyle area(shadestyle(intensity(50))) editcopy
gr_edit plotregion1.plot2.style.editstyle line(color(maroon)) editcopy
graph save "Figure 2C - Actions and NatID Treat.gph", replace

gr combine "Figure 2C - Vote and NatID.gph" "Figure 2C - Vote and NatID Treat.gph" ///
"Figure 2C - Enthus and NatID.gph"  "Figure 2C - Enthus and NatID Treat.gph" /// 
"Figure 2C - Actions and NatID.gph" "Figure 2C - Actions and NatID Treat.gph" ///
, row(3) scheme(plottig) commonscheme name(VoteNationalOriginID, replace)
graph display VoteNationalOriginID, xsize(4) ysize(6)
graph save "Figure 2C - National Origin ID.gph", replace
graph export "Figure 2C - National Origin ID.pdf", as(pdf) replace



esttab willvote voteethusiasm politicalaction using Table2CVoteNatID.rtf , replace se r2 ar2  b(a2) compress modelwidth(8) ///
 nobaselevels label title(National Origin Identity)   nonumbers mtitles("Will Vote" "Vote Enthusiasm" "Political Actions") ///
  rename (1.smalltreatment Treatment natID NationalOriginID   1.smalltreatment#c.natID Treatment*NOID  interest Interest previousvote ///
 2018Turnout 1.PID Rep 3.PID Dem age Age income_new Income edu Education woman Woman employed Employed imm Immigrant) 

esttab willvote voteethusiasm politicalaction using Table2CVoteNatID.tex, replace se r2 ar2  b(a2) compress modelwidth(8) ///
 nobaselevels label title(National Origin Identity)   nonumbers mtitles("Will Vote" "Vote Enthusiasm" "Political Actions") ///
  rename (1.smalltreatment Treatment natID NationalOriginID   1.smalltreatment#c.natID Treatment*NOID  interest Interest previousvote ///
 2018Turnout 1.PID Rep 3.PID Dem age Age income_new Income edu Education woman Woman employed Employed imm Immigrant) 




 
 //Party Conditions
 
reg willvote i.smalltreatment##i.Cparty interest previousvote ib2.PID age income edu  woman employ imm  if firsttime==1 & reject==0 & newwording==. & speeder==0 
est store willvote
margins, over(r.smalltreatment ) at((mean)_all Cparty=(0 1))
marginsplot, name(voteParty, replace)  title("Will Vote - Treatment Effects", bexpand nospan)  ytitle("Treatment Effect") xtitle("Candidate Affiliation") yline(0, lcolor(black))

reg voteethusiasm i.smalltreatment##i.Cparty interest previousvote ib2.PID age income edu  woman employ imm  if firsttime==1 & reject==0 & newwording==. & speeder==0 
est store voteethusiasm
margins, over(r.smalltreatment ) at((mean)_all Cparty=(0 1))
marginsplot, name(enthusiasmParty, replace) title("Vote Enthusiasm - Treatment Effects", bexpand nospan) ytitle("Treatment Effect") xtitle("Candidate Affiliation") yline(0, lcolor(black))

reg politicalaction i.smalltreatment##i.Cparty interest previousvote ib2.PID age income edu  woman employ imm  if firsttime==1 & reject==0 & newwording==. & speeder==0 
est store politicalaction
margins, over(r.smalltreatment ) at((mean)_all Cparty=(0 1))
marginsplot, name(actionParty, replace) title("Political Actions - Treatment Effects", bexpand nospan) ytitle("Treatment Effect") xtitle("Candidate Affiliation") yline(0, lcolor(black))

gr combine voteParty enthusiasmParty actionParty,  scheme(plottig) commonscheme name(PartyConditions, replace)
graph save "Figure 1E - Party Condition.gph", replace
graph export "Figure 1E - Party Condition.pdf", as(pdf) replace


esttab willvote voteethusiasm politicalaction using Table1EParty.rtf , replace se r2 ar2  b(a2) compress modelwidth(8) ///
 nobaselevels label title(Candidate Party Affiliation)   nonumbers mtitles("Will Vote" "Vote Enthusiasm" "Political Actions") ///
 rename (1.smalltreatment Treatment 1.Cparty CandParty ///
 1.smalltreatment#1.Cparty Treatment*CandParty interest Interest previousvote ///
 2018Turnout 1.PID Rep 3.PID Dem age Age income_new Income edu Education woman Woman employed Employed imm Immigrant)

esttab willvote voteethusiasm politicalaction using Table1EParty.tex, replace se r2 ar2  b(a2) compress modelwidth(8) ///
 nobaselevels label title(Candidate Party Affiliation)   nonumbers mtitles("Will Vote" "Vote Enthusiasm" "Political Actions") ///
 rename (1.smalltreatment Treatment 1.Cparty CandParty ///
 1.smalltreatment#1.Cparty Treatment*CandParty interest Interest previousvote ///
 2018Turnout 1.PID Rep 3.PID Dem age Age income_new Income edu Education woman Woman employed Employed imm Immigrant)

 
 
//  Sample Demographics
summarize income if firsttime==1 & reject==0 & newwording==. & speeder==0, detail
summarize edu  if firsttime==1 & reject==0 & newwording==. & speeder==0, detail
summarize age  if firsttime==1 & reject==0 & newwording==. & speeder==0, detail
tab woman  if firsttime==1 & reject==0 & newwording==. & speeder==0
tab imm  if firsttime==1 & reject==0 & newwording==. & speeder==0



estpost summarize age  edu income imm employ woman mexican puertorican cuban dominican othernat ///
willvote voteethusiasm politicalaction interest  previousvote  ethID Democrat Republican Independent , detail
esttab,   nomtitle nonumber label collabels("Mean" "Std. Dev." "Minimum" "Maximum") ///
cells("mean(fmt(%8.2f)) sd(fmt(%8.2f)) min(fmt(%8.2f)) max(fmt(%8.2f))")

esttab using "summary.doc", replace   nomtitle nonumber label collabels("Mean" "Median" "Std. Dev." "Minimum" "Maximum") ///
cells("mean(fmt(%8.2f)) p50(fmt(%8.2f)) sd(fmt(%8.2f)) min(fmt(%8.2f)) max(fmt(%8.2f))")


esttab using "summary.tex", replace   nomtitle nonumber label collabels("Mean" "Median" "Std. Dev." "Minimum" "Maximum") ///
cells("mean(fmt(%8.2f)) p50(fmt(%8.2f)) sd(fmt(%8.2f)) min(fmt(%8.2f)) max(fmt(%8.2f))")


//Balance Test
balancetable smalltreatment age income edu  woman employ imm ///
using "balancetable.xls", ctitles("Control group" "Treatment group" "Difference" "P-value") pval varlabels  wide(mean1 mean2 diff pval) replace

balancetable smalltreatment age income edu  woman employ imm ///
using "balancetable.tex", ctitles("Control group" "Treatment group" "Difference" "P-value") pval varlabels  wide(mean1 mean2 diff pval) replace


 